package net.yxsoft.controller.common.interceptor;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;
import com.jfinal.core.Controller;
import net.yxsoft.resource.Res;

/**
 * 全局拦截器
 *
 * @author zhaohaibo
 */
public class GlobalInterceptor implements Interceptor {
  @Override
  public void intercept(Invocation invocation) {
    Controller c = invocation.getController();

    c.setAttr(Res.KEY_PAGE_TITLE_SYS, Res.PAGE_TITLE_SYS);
    c.setAttr(Res.KEY_PAGE_SUB_TITLE_SYS, Res.PAGE_SUB_TITLE_SYS);

    c.setAttr(Res.KEY_PAGE_TITLE_SYS, Res.PAGE_TITLE_CONSUMER);
    c.setAttr(Res.KEY_PAGE_SUB_TITLE_SYS, Res.PAGE_SUB_TITLE_CONSUMER);

    invocation.invoke();
  }
}
